]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Expose scroll-events
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 22 Oct 2012 15:39:19 +0000 (17:39 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 20 Feb 2013 19:17:19 +0000 (20:17 +0100)
Using the scroll wheel in the window picker should switch workspaces.
As the picker doesn't have a visible boundary though, it makes sense
to accept scroll-event for the entire overview area. Rather than
making the overview's main actor public, expose scroll-events via
a signal.

https://bugzilla.gnome.org/show_bug.cgi?id=686639

js/ui/overview.js

index 755dfb4b209cd7d73967ba7a31368f246a1c4f36..13f348aeb2bb8676544f3722d17289f020fe191b 100644 (file)
@@ -125,6 +125,7 @@ const Overview = new Lang.Class({
         this._overview._delegate = this;
 
         this._group = new St.BoxLayout({ name: 'overview-group',
+                                         reactive: true,
                                          clip_to_allocation: true });
 
         this._backgroundGroup = new Meta.BackgroundGroup();
@@ -164,6 +165,7 @@ const Overview = new Lang.Class({
         Main.xdndHandler.connect('drag-end', Lang.bind(this, this._onDragEnd));
 
         global.screen.connect('restacked', Lang.bind(this, this._onRestacked));
+        this._group.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
 
         this._windowSwitchTimeoutId = 0;
         this._windowSwitchTimestamp = 0;
@@ -379,6 +381,10 @@ const Overview = new Lang.Class({
         return DND.DragMotionResult.CONTINUE;
     },
 
+    _onScrollEvent: function(actor, event) {
+        this.emit('scroll-event', event);
+    },
+
     addAction: function(action) {
         if (this.isDummy)
             return;